package org.jeecg.glr.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.glr.entity.GlrLed;

import java.util.List;

/**
 * @Description: LED屏管理
 * @Author: jeecg-boot
 * @Date:   2020-02-20
 * @Version: V1.0
 */
public interface GlrLedMapper extends BaseMapper<GlrLed> {
    @Select("SELECT id,code,status from glr_led WHERE id in (${str})")
    List<GlrLed> getLedByIds(@Param("str")String str);
    @Select("SELECT * from glr_led WHERE code=#{code}")
    GlrLed getLedByCode(@Param("code")String code);

    /**
     *
     * 功能描述: 发布资源后绑定commandId
     *
     * @param:
     * @return: 
     * @auther: Administrator
     * @date: 2020/3/5 14:54
     */
    void updateCommandId(@Param("code") String code,@Param("commandId") String commandId);

    /**
     *
     * 功能描述: 监测LED屏下载资源的状态
     *
     * @param:
     * @return: 
     * @auther: Administrator
     * @date: 2020/3/6 9:23
     */
    void updateProgressByCommandId(@Param("progress") String progress,@Param("commandId") String commandId);

    void updateBrightnessByCode(@Param("brightness")Integer brightness,@Param("code") String code);

    @Select("${sql}")
    List<String> getLedStatus(@Param("sql")String sql);
}
